


const TIMEOUT = 30000;




export default (configs:g.ApiBase):any => {

  let {url,data} = configs;
  let header = {
    'content-type': 'application/json'
  }



    return new Promise((resolve,reject)=>{
          uni.request({
            url,
            method:"POST",
            header,
            data,
            timeout:TIMEOUT,
              success:(res:any)=>resolve(res),
              fail:(err:any)=>{
                  uni.hideLoading();
                  reject(err);
                  uni.showToast({
                    title:'网络超时',
                    icon:'none',
                    duration: 3000
                })
              }
          })
    })

  
  
}
